import React from 'react'
import { Tabs } from 'react-vant'

function Index(props) {
    const {antPlatId,zxlist,zxData,handelTab}=props
  
  return (
    <div>
      <Tabs active={zxData.findIndex(item => item.id === antPlatId)}
          onChange={handelTab}>
          {zxData.map((item, index) => (
            <Tabs.TabPane key={index} title={item.name}>
              {zxlist.length > 0 ? (
                zxlist.map((itm, ind) => (
                  <div className='yy1' key={ind}>
                    <img src={itm.thumbnail} alt="" style={{ width: '150px', height: "100px" }} />
                    <div className='yy2'>
                      <p className='yyy2'>{itm.title}</p>
                      <p className='yyy1'>{itm.source}</p>
                    </div>
                  </div>
                ))
              ) : (<div>暂无该分类下的资讯内容</div>)
              }
            </Tabs.TabPane>
          ))}
        </Tabs>
    </div>
  )
}

export default Index
